#include <bits/stdc++.h>
using namespace std;

int read() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') f *= -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x * 10 + c - '0';
        c = getchar();
    }
    return x * f;
}

void print(int x) {
    if (x < 0) {
        putchar('-');
        x *= -1;
    }
    if (x > 9) print(x / 10);
    putchar(x % 10 + '0');
}
void el() {
    puts("");
}

int main() {
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);
    srand((unsigned(time(0))));
    int n = read(), m = read();
    for (int i = 1; i <= 8; i++) {
        print(rand() % (n * m));
        el();
    }
    return 0;
}
